package com.clhbolg.model.es;

import cn.easyes.annotation.HighLight;
import cn.easyes.annotation.IndexField;
import cn.easyes.annotation.IndexId;
import cn.easyes.annotation.IndexName;
import cn.easyes.annotation.rely.Analyzer;
import cn.easyes.annotation.rely.FieldType;
import cn.easyes.annotation.rely.IdType;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@IndexName("myarticle")
public class ArticleSearchDTO {

    @IndexId(type = IdType.CUSTOMIZE)
    private Long id;

    @IndexField(fieldType = FieldType.TEXT, analyzer = Analyzer.IK_MAX_WORD)
    @HighLight(preTag = "<mark>",postTag = "</mark>")
    private String articleTitle;

    @IndexField(fieldType = FieldType.TEXT, analyzer = Analyzer.IK_MAX_WORD)
    @HighLight(preTag = "<mark>",postTag = "</mark>",fragmentSize = 50)
    private String articleContent;

    @IndexField(fieldType = FieldType.INTEGER)
    private Integer isDelete;

    @IndexField(fieldType = FieldType.INTEGER)
    private Integer status;

//    private String highlightContent;
}

//@Document(indexName = "MyArticle")
//public class ArticleSearchDTO {
//
//    @Id
//    private Integer id;
//
//    @Field(type = FieldType.Text, analyzer = "ik_max_word")
//    private String articleTitle;
//
//    @Field(type = FieldType.Text, analyzer = "ik_max_word")
//    private String articleContent;
//
//    @Field(type = FieldType.Integer)
//    private Integer isDelete;
//
//    @Field(type = FieldType.Integer)
//    private Integer status;
//
//
//}
